﻿@model PotentialAdviceViewModel
@{
    Layout = null;
    ViewBag.Title = "隐患整改通知书台账-列表";
}

<div class="page" style="border-top:1px solid #b8d0d6;" layouth="1">
@using (Html.BeginForm("SplitPage", "ScmPotentialAdvice", null, FormMethod.Post, new { id = "pagerForm", onsubmit = "return navTabSearch(this);" }))
{
    <input type="hidden" name="pageNum" value="1" />
    <input type="hidden" name="numPerPage" value="@(ViewBag.numPerPage)" />
    <ul class="searchBar">
        <li><span>合同段：</span>
            <input type="text" name="contract" value="@(ViewBag.contract)" />
        </li>
        <li><span>日期：</span>
            <input type="text" name="date" value="@(ViewBag.date)" class="date"/>
        </li>
        <li>
            <button type="submit" class="btn btn-success btn-xs">
                搜索</button>
        </li>
    </ul>
}
<div class="panelBar" style="border-top: none;">
    <ul class="toolBar">
        <li>
            @Html.PermissionButton("SafetyConstruction.ScmPotentialAdvice.Create", "tzgl_yhzg_add",
                    Url.Action("PotentialAdviceAdd", "ScmPotentialAdvice"),
                    "添加",
                    new Dictionary<string, object>
                    {
                        {"class","add"},{"rel","tzgl_yhzg_add"} ,{"mask","true"},{"target","dialog"},{"width","400"},{"height","400"}
                    })
        </li>
        <li>
            @Html.PermissionButton("SafetyConstruction.ScmPotentialAdvice.Delete", "tzgl_yhzg_del",
                    Url.Action("PotentialAdviceMultiDelete", "ScmPotentialAdvice", new { id = "{ids}" }),
                    "删除",
                    new Dictionary<string, object>
                    {
                        {"class","delete"},{"rel","ids"} ,{"title","确定要删除该条记录吗？"},{"target","ajaxTodo"},{"postType","string"}
                    })
        </li>
        <li>
            @Html.PermissionButton("SafetyConstruction.ScmPotentialAdvice.Edit", "tzgl_yhzg_edit",
                    Url.Action("PotentialAdviceEdit", "ScmPotentialAdvice", new { id = "{ids}" }),
                    "修改",
                    new Dictionary<string, object>
                    {
                        {"class","edit"},{"rel","tzgl_yhzg_edit"} ,{"warn","请选择一条信息！"},{"target","dialog"},{"mask","true"},{"width","400"},{"height","400"}
                    })
        </li>
        <li>
            @Html.PermissionButton("SafetyConstruction.ScmPotentialAdvice.Detail", "tzgl_yhzg_detail",
                    Url.Action("PotentialAdviceDetail", "ScmPotentialAdvice", new { id = "{ids}" }),
                    "查看",
                    new Dictionary<string, object>
                    {
                        {"class","detail"},{"rel","tzgl_yhzg_detail"} ,{"warn","请选择一条信息！"},{"target","dialog"},{"mask","true"},{"width","480"},{"height","400"}
                    })
        </li>
        <li class="line">line</li>
        <li>
            @Html.PermissionButton("SafetyConstruction.ScmPotentialAdvice.Download", "tzgl_yhzg_download",
                    "../../Areas/SafetyConstruction/Upload/隐患整改通知书台账.xls",
                    "模板",
                    new Dictionary<string, object>
                    {
                        {"class","download"},{"targettype","navTab"} ,{"title","导入模板下载"}
                    })
        </li>
        <li>
            @Html.PermissionButton("SafetyConstruction.ScmPotentialAdvice.Input", "tzgl_yhzg_input",
                    Url.Action("Index", "Import", new { url = "/ScmPotentialAdvice/ImportExcelFile" }),
                    "导入",
                    new Dictionary<string, object>
                    {
                        {"class","input"},{"rel","tzgl_yhzg_input"} ,{"lookupgroup","attachment"},{"mask","true"},{"width","320"},{"height","320"},{"title","导入EXCEL"}
                    })
        </li>
        <li>
            @Html.PermissionButton("SafetyConstruction.ScmPotentialAdvice.Export", "tzgl_yhzg_export",
                    Url.Action("Excel", "ScmPotentialAdvice"),
                    "导出",
                    new Dictionary<string, object>
                    {
                        {"class","export"},{"targettype","navTab"} ,{"title","导出EXCEL"}
                    })
        </li>
    </ul>
</div>
<table class="table" width="100%" layouth="122" nowraptd="false">
    <thead>
        <tr>
            <th style="text-align: center;display:none" width="22">
                <input type="checkbox" group="ids" class="checkboxCtrl">
            </th>
            <th style="text-align: center" width="30">
                序号
            </th>
            <th style="text-align: center" width="45">
                合同段
            </th>
            <th style="text-align: center" width="65">
                日期
            </th>
            <th style="text-align: center" width="80">
                编号
            </th>
            <th style="text-align: center" width="100">
                检查地点
            </th>
            <th style="text-align: center" width="120">
                安全隐患问题
            </th>
            <th style="text-align: center" width="85">
                监理审核回复（是/否）
            </th>
            <th style="text-align: center" width="65">
                回复日期
            </th>
            <th style="text-align: center" width="60">
                整改情况
            </th>
            <th style="text-align: center" width="70">
                备注
            </th>
        </tr>
    </thead>
    <tbody>
        @{ int num = (ViewBag.pageNum - 1) * ViewBag.numPerPage;}
        @foreach (var item in Model.PotentialAdviceList)
        {
            num += 1;
            <tr target="ids" rel="@item.Pa_ID">
                <td style="text-align: center;display:none">
                    <input name="ids" value="@item.Pa_ID" type="checkbox">
                </td>
                <td style="text-align: center">@num
                </td>
                <td style="text-align: center">@item.Pa_Section
                </td>
                <td style="text-align: center">@(item.Pa_Date == null ? "" : Convert.ToDateTime(item.Pa_Date).ToString("yyyy-MM-dd"))
                </td>
                <td style="text-align: center">@item.Pa_Number
                </td>
                <td style="text-align: center">@item.Pa_Location
                </td>
                <td style="text-align: center">@item.Pa_Problem
                </td>
                <td style="text-align: center">@(item.Pa_IsCheck == false ? "否" : "是")
                </td>
                <td style="text-align: center">@(item.Pa_ReplyDate == null ? "" : Convert.ToDateTime(item.Pa_ReplyDate).ToString("yyyy-MM-dd"))
                </td>
                <td style="text-align: center">@item.Pa_Correct
                </td>
                <td style="text-align: center">@item.Pa_Remark
                </td>
            </tr>
        }
    </tbody>
</table>
<div class="panelBar" style="border-bottom:none;">
    <div class="pages"  style="float: right">
        <span>显示</span>
        <select class="comsplitpage" id="numPerPage" onchange="navTabPageBreak({numPerPage:this.value})">
           <option value="10" @(ViewBag.numPerPage == 10 ? "selected='selected'" : "")>10</option>
                <option value="20" @(ViewBag.numPerPage == 20 ? "selected='selected'" : "")>20</option>
                <option value="50" @(ViewBag.numPerPage == 50 ? "selected='selected'" : "")>50</option>
        </select>
        <span>条，共@(ViewBag.pagenumshown)页,@(ViewBag.totalcount)条</span>
    </div>
    <div class="pagination" style="margin:0px;float:left; margin-left:35%" targettype="navTab" totalcount="@(ViewBag.totalcount)" numperpage="@(ViewBag.numPerPage)" pagenumshown="10" currentpage="@(ViewBag.pageNum)">
    </div>
</div>
</div>